import { WxBindingUserResultModel } from './dto/wxBindingUserResultModel';
import { AuthenticationModel } from './dto/authenticationModel';
import { AuthenticationResultModel } from './dto/authenticationResultModel';
import http from '../httpService';
import { WxOpenAuthenticationModel } from './dto/wxOpenAuthenticationModel';
import { WxAuthenticationResultModel } from './dto/wxAuthenticationResultModel';
import { WxBindingNoneUserModel } from './dto/wxBindingNoneUserModel';

class TokenAuthService {
  public async authenticate(authenticationInput: AuthenticationModel): Promise<AuthenticationResultModel> {
    let result = await http.post('/api/TokenAuth/Authenticate', authenticationInput);
    return result.data.result;
  }

  public async wxOpenAuthenticate(authenticationInput: WxOpenAuthenticationModel): Promise<WxAuthenticationResultModel> {
    let result = await http.post('/api/TokenAuth/wxOpenAuthenticate', authenticationInput);
    return result.data.result;
  }

  public async wxBindingNoneUser(authenticationInput: WxBindingNoneUserModel): Promise<WxBindingUserResultModel> {
    let result = await http.post('/api/TokenAuth/wxBindingNoneUser', authenticationInput);
    return result.data.result;
  }
}

export default new TokenAuthService();
